package model.enums.common;


/**
 * @author 清风明月
 * @Package model.enums.common
 * @date 2025/5/18
 * @description 是否签到
 */
@SuppressWarnings("all")
public enum SignInStatus {

    NOT_SIGN_IN(0, "未签到"),
    HAS_SIGN_IN(1, "已签到");

    private Integer code;
    private String desc;

    SignInStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据code获取枚举
     * @param code
     * @return
     */
    public static SignInStatus getEnumByCode(Integer code) {
        for (SignInStatus status : SignInStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
